import type { App, Component, DefineComponent } from 'vue'
type compOpts = {
  name: string // 这里重新定义name是因为有些组件可能并没有name
  component: Component | DefineComponent
}
const components: Array<compOpts> = [] // 汇总需要全局注册的组件， 可以通过components = components.concat(arr)

export function registerGlobalComps(app: App) {
  for (const comp of components) {
    app.component(comp.name, comp.component)
  }
}
